package com.yc.ioc.test.bean2;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component("address")
public class Address {
    String province;
    String city;
    String county;

    public Address(String province, String city, String county) {
        this.province = province;
        this.city = city;
        this.county = county;
    }

    public Address() {
    }
    @Value("湖南")
    public void setProvince(String province) {
        this.province = province;
    }
    @Value("衡阳")
    public void setCity(String city) {
        this.city = city;
    }
    @Value("珠晖")
    public void setCounty(String county) {
        this.county = county;
    }

    @Override
    public String toString() {
        return "Address{" +
                "province='" + province + '\'' +
                ", city='" + city + '\'' +
                ", county='" + county + '\'' +
                '}';
    }
}
